<#import "../macro/components.ftl" as components/>
<#include "../macro/layout_default.ftl"/>
<@head>
<link rel="stylesheet" href="/misc/adminlte-2.3.7/plugins/daterangepicker/daterangepicker.css"/>
</@head>
<@body>
<script src="/misc/adminlte-2.3.7/plugins/iCheck/icheck.min.js"></script>
<script src="/misc/app/js/salesman_cash_list.js"></script>
</@body>
<@layout_default>
<div class="box">
	<div class="box-header with-border">
	   <span class="pull-left text-muted">支付（${proname!}_${procode!}）</span>
	</div>
    <div class="box-header with-border">
        <form name="form_query" class="form-inline" action="/payment/detail">
        	<input type="hidden" name="price" value="${price!}"/>
        	<input type="hidden" name="product_id" id ="product_id" value="${product_id!}"/>
        	<input type="hidden" name="proname" value="${proname!}"/>
    	    <input type="hidden" name="procode" value="${procode!}"/>
            <div class="input-group">
                <div class="input-group-addon">促销员</div>
                <input type="text" class="form-control" style="width: 260px" name="keyword" value="${keyword!}" placeholder="促销员名称"/>
            </div>
            <div class="input-group">
                <div class="input-group-addon">单位</div>
                <input type="text" class="form-control" style="width: 260px" name="companyname" value="${companyname!}" placeholder="单位名称"/>
            </div>
            <button type="submit" class="btn btn-warning"><i class="fa fa-search"></i> 查询</button>
            <button type="button" class="btn btn-warning" name="btn_payment"><i class="fa fa-comment"></i> 支付</button>
        </form>
    </div>
    
    
    <!-- /.box-header -->
    <div class="box-body mailbox-messages" id="mailbox-messages">
        <table class="table table-striped table-hover">
            <tr>
            	<td><button type="button" class="btn btn-default btn-sm checkbox-toggle" style=" border-color: rgba(255,255,255,0.15);"><i class="fa fa-square-o"></i>
                </button></td>
                <th>ID</th>
                <th>促销员</th>
                <th>单位</th>
                <th>数量（瓶）/扫码次数</th>
                <th>每瓶费用</th>
                <th>小计</th>
                <th>状态</th>
                
            </tr>
            <#if (pagelist.result?size > 0)>
                <#list pagelist.result as item>
                    <tr>
                    	<td style="padding-left: 17px;">
                    	    <input type="hidden" id="salesman_id${item.id}" value="${item.salesman_id}"/>
                    	    <input type="hidden" id="company_id${item.id}" value="${item.company_id}"/>
                    	    <input type="hidden" id="product_id${item.id}" value="${item.product_id}"/>
                    	    <input type="hidden" id="nubs${item.id}" value="${item.nubs}"/>
                    	    <input type="hidden" id="sumprice${item.id}" value="${item.sumprice1}"/>
                    	    <input type="hidden" id="price${item.id}" value="${item.price}"/>
                    	    <input type="hidden" id="id${item.id}" value="false"/>
                    	    <input type="hidden" id="openid${item.id}" value="${item.openid}"/>
                    	    <input type="hidden" id="appid${item.id}" value="${item.appid}"/>
                    	    <input type="hidden" id="tableid${item.id}" value="${item.tableid}"/>
                    		<input type="checkbox"  id="${item.id}" name ="node_checker" clicks ="checked">
                    	</td>
                        <td>${item.id}</td>
                        <td>${item.salename}</td>
                        <td>${item.company_name}</td>
                        <td>${item.nubs!}</td>
                        <td>${item.price!}</td>
                        <td>${item.sumprice1!}</td>
                        <td><div id="zf${item.id}"><#if item.payment_state==1><span class="text-green">已支付</span><#else><span class="text-danger">未支付</span></#if>   </div></td>
                    </tr>
                </#list>
            <#else>
                <tr>
                    <td class="text-center text-muted" colspan="9"><i class="fa fa-info-circle"></i> 没有记录</td>
                </tr>
            </#if>
        </table>
        <table class="table table-striped table-hover">
        	<tr>
        		<span class="pull-right text-muted">共 ${pagelist.resultTotal} 条记录</span>
        	</tr>
        </table>
    </div>
    <!-- /.box-body -->
    <div class="box-footer text-center">
        <@components.pagination "/salesman?keyword=${keyword!}&page=$page&companyname=${companyname!}&price=${price!}&product_id=${product_id!}&proname=${proname!}&procode=${procode!}",pagelist.page,pagelist.pageTotal/>
    </div>
</div>

<!-- md_edit_salesman -->
<div class="modal" id="md_edit_price" tabindex="-1">
    <div class="modal-dialog"  style=" width: 300px;"role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel"><i class="fa fa-pencil-square-o"></i> 请确认每瓶支付费用</h4>
            </div>
            <div class="modal-body">
                <form class="form-horizontal" name="form_edit_price">
                    <input type="hidden" name="productid"/>
                    <input type="hidden" name="productname"/>
                    <div class="form-group">
                        <label class="col-sm-2 control-label"><strong class="bold">￥</strong> </label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" placeholder="每瓶支付费用" name="price" onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')" />
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary" name="btn_save_price">保存</button>
            </div>
        </div>
    </div>
</div>


</@layout_default>